
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Android支付SDK-JPay · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="weixin_guide.html" />
    
    
    <link rel="prev" href="IJPay.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    项目导航
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../contact.html">
            
                <a href="../contact.html">
            
                    
                    联系方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../study.html">
            
                <a href="../study.html">
            
                    
                    学习资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../gitchat.html">
            
                <a href="../gitchat.html">
            
                    
                    GitChat交流
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../blog/">
            
                <a href="../blog/">
            
                    
                    我的博客
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="./">
            
                <a href="./">
            
                    
                    开源项目
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="IJPay.html">
            
                <a href="IJPay.html">
            
                    
                    What is a IJPay?
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.6.2" data-path="JPay.html">
            
                <a href="JPay.html">
            
                    
                    Android支付SDK-JPay
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="weixin_guide.html">
            
                <a href="weixin_guide.html">
            
                    
                    极速开发微信公众号
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../ijpay/">
            
                <a href="../ijpay/">
            
                    
                    IJPay 文档
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../IJPay-Demo.html">
            
                <a href="../IJPay-Demo.html">
            
                    
                    IJPay-Demo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../ijpay/alipay/">
            
                <a href="../ijpay/alipay/">
            
                    
                    支付宝支付
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.1" data-path="../ijpay/alipay/alipay-config.html">
            
                <a href="../ijpay/alipay/alipay-config.html">
            
                    
                    配置应用环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.2" data-path="../ijpay/alipay/alipay-init.html">
            
                <a href="../ijpay/alipay/alipay-init.html">
            
                    
                    IJPay 支付宝初始化
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.3" data-path="../ijpay/alipay/alipay-wap.html">
            
                <a href="../ijpay/alipay/alipay-wap.html">
            
                    
                    支付宝手机网站支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.4" data-path="../ijpay/alipay/alipay-pc.html">
            
                <a href="../ijpay/alipay/alipay-pc.html">
            
                    
                    支付宝电脑网站支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.5" data-path="../ijpay/alipay/alipay-offline.html">
            
                <a href="../ijpay/alipay/alipay-offline.html">
            
                    
                    当面付
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.5.1" data-path="../ijpay/alipay/alipay-offline/alipay-qrPay.html">
            
                <a href="../ijpay/alipay/alipay-offline/alipay-qrPay.html">
            
                    
                    支付宝扫码支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.5.2" data-path="../ijpay/alipay/alipay-offline/alipay-barPay.html">
            
                <a href="../ijpay/alipay/alipay-offline/alipay-barPay.html">
            
                    
                    支付宝条码支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.5.3" data-path="../ijpay/alipay/alipay-offline/alipay-wavePay.html">
            
                <a href="../ijpay/alipay/alipay-offline/alipay-wavePay.html">
            
                    
                    支付宝声波支付
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.2.6" data-path="../ijpay/alipay/alipay-coupon.html">
            
                <a href="../ijpay/alipay/alipay-coupon.html">
            
                    
                    支付宝红包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.7" data-path="../ijpay/alipay/alipay-transfer.html">
            
                <a href="../ijpay/alipay/alipay-transfer.html">
            
                    
                    支付宝提现
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.8" data-path="../ijpay/alipay/alipay-app.html">
            
                <a href="../ijpay/alipay/alipay-app.html">
            
                    
                    支付宝APP支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.9" data-path="../ijpay/alipay/alipay-notify.html">
            
                <a href="../ijpay/alipay/alipay-notify.html">
            
                    
                    支付宝服务端异步通知
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.10" data-path="../ijpay/alipay/alipay-api.html">
            
                <a href="../ijpay/alipay/alipay-api.html">
            
                    
                    支付宝API字典
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../ijpay/wxpay/">
            
                <a href="../ijpay/wxpay/">
            
                    
                    微信支付
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="../ijpay/wxpay/wxapi.html">
            
                <a href="../ijpay/wxpay/wxapi.html">
            
                    
                    微信公用API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="../ijpay/wxpay/allapi.html">
            
                <a href="../ijpay/wxpay/allapi.html">
            
                    
                    微信支付API接口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="../ijpay/wxpay/micropay.html">
            
                <a href="../ijpay/wxpay/micropay.html">
            
                    
                    微信刷卡支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="../ijpay/wxpay/wechatPay.html">
            
                <a href="../ijpay/wxpay/wechatPay.html">
            
                    
                    微信公众号支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="../ijpay/wxpay/qrPay.html">
            
                <a href="../ijpay/wxpay/qrPay.html">
            
                    
                    微信扫码支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.6" data-path="../ijpay/wxpay/appPay.html">
            
                <a href="../ijpay/wxpay/appPay.html">
            
                    
                    微信APP支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.7" data-path="../ijpay/wxpay/H5.html">
            
                <a href="../ijpay/wxpay/H5.html">
            
                    
                    微信H5支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.8" data-path="../ijpay/wxpay/wxapp.html">
            
                <a href="../ijpay/wxpay/wxapp.html">
            
                    
                    微信小程序支付
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.9" data-path="../ijpay/wxpay/redpack.html">
            
                <a href="../ijpay/wxpay/redpack.html">
            
                    
                    微信现金红包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.10" data-path="../ijpay/wxpay/transfers.html">
            
                <a href="../ijpay/wxpay/transfers.html">
            
                    
                    微信企业付款
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.11" data-path="../ijpay/wxpay/refund.html">
            
                <a href="../ijpay/wxpay/refund.html">
            
                    
                    微信退款
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.12" data-path="../ijpay/wxpay/wxpay-notify.html">
            
                <a href="../ijpay/wxpay/wxpay-notify.html">
            
                    
                    服务端异步通知
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Android支付SDK-JPay</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="android&#x652F;&#x4ED8;sdk-jpay">Android&#x652F;&#x4ED8;SDK-JPay</h1>
<p>&#x1F525;&#x5BF9;&#x5FAE;&#x4FE1;App&#x652F;&#x4ED8;&#x3001;&#x652F;&#x4ED8;&#x5B9D;App&#x652F;&#x4ED8;&#x3001;&#x94F6;&#x8054;APP&#x652F;&#x4ED8;&#x7684;&#x4E8C;&#x6B21;&#x5C01;&#x88C5;,&#x5BF9;&#x5916;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x76F8;&#x5BF9;&#x7B80;&#x5355;&#x7684;&#x63A5;&#x53E3;&#x4EE5;&#x53CA;&#x652F;&#x4ED8;&#x7ED3;&#x679C;&#x7684;&#x56DE;&#x8C03;&#x3002;</p>
<p><img src="https://img.shields.io/github/stars/Javen205/JPay.svg?style=social&amp;label=Stars" alt="">    <img src="https://img.shields.io/github/forks/Javen205/JPay.svg?style=social&amp;label=Fork" alt="">    <a href="https://www.apache.org/licenses/LICENSE-2.0" target="_blank"><img src="https://img.shields.io/badge/license-Apache%202-green.svg" alt="License"></a>    <a href="https://jitpack.io/#javen205/JPay" target="_blank"><img src="https://jitpack.io/v/javen205/JPay.svg" alt=""></a>    <a href="http://blog.csdn.net/zyw_java" target="_blank"><img src="https://img.shields.io/badge/JPay%20OR%20IJPay%20Author-Javen-ff69b4.svg" alt="JPay Author"></a></p>
<p>GitHub:<a href="https://github.com/Javen205/JPay" target="_blank">https://github.com/Javen205/JPay</a></p>
<p>Gitee:<a href="http://gitee.com/Javen205/JPay" target="_blank">http://gitee.com/Javen205/JPay</a></p>
<p><a href="https://github.com/Javen205/JPay/wiki/%E7%89%88%E6%9C%AC%E6%9B%B4%E6%96%B0%E8%AE%B0%E5%BD%95" target="_blank">&#x7248;&#x672C;&#x66F4;&#x65B0;&#x8BB0;&#x5F55;</a></p>
<p><strong>&#x8054;&#x7CFB;&#x65B9;&#x5F0F;</strong></p>
<p><a href="http://shang.qq.com/wpa/qunwpa?idkey=5005dbbee62dac64b34fedc9ff73511762da5d02642a1ef526522fb2e07852dd" target="_blank"><img src="https://img.shields.io/badge/QQ&#x7FA4;-148540125-fba7f9.svg" alt="QQ0Group"></a>    <a href="http://blog.csdn.net/zyw_java" target="_blank"><img src="https://img.shields.io/badge/Email-javendev%40126.com-yellowgreen.svg" alt="Email"></a></p>
<p><strong>&#x4F7F;&#x7528;&#x65B9;&#x6CD5;</strong></p>
<h3 id="1&#x3001;&#x5750;&#x6807;">1&#x3001;&#x5750;&#x6807;</h3>
<p>Step 1. Add it in your root build.gradle at the end of repositories:</p>
<pre><code>    allprojects {
        repositories {
            ...
            maven { url &apos;https://jitpack.io&apos; }
        }
    }
</code></pre><p>Step 2. Add the dependency</p>
<pre><code>compile &apos;com.github.javen205.JPay:JPay:latest.release.here&apos;
</code></pre><p>&#x4F8B;&#x5982;&#xFF1A;&#x7248;&#x672C;&#x53F7;&#x4E3A;<code>0.0.4</code></p>
<pre><code>compile &apos;com.github.javen205.JPay:JPay:0.0.4&apos;
</code></pre><h3 id="2-android-manifest&#x914D;&#x7F6E;">2. Android Manifest&#x914D;&#x7F6E;</h3>
<h5 id="21&#x6743;&#x9650;&#x58F0;&#x660E;">2.1&#x6743;&#x9650;&#x58F0;&#x660E;</h5>
<pre><code>&lt;uses-permission android:name=&quot;android.permission.INTERNET&quot;/&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_NETWORK_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.ACCESS_WIFI_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.READ_PHONE_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.WRITE_EXTERNAL_STORAGE&quot; /&gt;

&lt;uses-permission android:name=&quot;android.permission.CHANGE_NETWORK_STATE&quot; /&gt;
&lt;uses-permission android:name=&quot;org.simalliance.openmobileapi.SMARTCARD&quot; /&gt;
&lt;uses-permission android:name=&quot;android.permission.NFC&quot; /&gt;
&lt;uses-feature android:name=&quot;android.hardware.nfc.hce&quot;/&gt;
</code></pre><h5 id="22&#x6CE8;&#x518C;activity">2.2&#x6CE8;&#x518C;activity</h5>
<p><code>application</code>&#x8282;&#x70B9;&#x6DFB;&#x52A0;&#x5982;&#x4E0B;&#x7C7B;&#x5BB9;</p>
<pre><code> &lt;!-- &#x5FAE;&#x4FE1;&#x652F;&#x4ED8; --&gt;
        &lt;activity
            android:name=&quot;com.jpay.weixin.WXPayEntryActivity&quot;
            android:configChanges=&quot;orientation|keyboardHidden|navigation|screenSize&quot;
            android:launchMode=&quot;singleTop&quot;
            android:theme=&quot;@android:style/Theme.Translucent.NoTitleBar&quot; /&gt;
        &lt;activity-alias
            android:name=&quot;.wxapi.WXPayEntryActivity&quot;
            android:exported=&quot;true&quot;
            android:targetActivity=&quot;com.jpay.weixin.WXPayEntryActivity&quot; /&gt;
        &lt;!-- &#x5FAE;&#x4FE1;&#x652F;&#x4ED8; end --&gt;


        &lt;!-- &#x652F;&#x4ED8;&#x5B9D;&#x652F;&#x4ED8; --&gt;

        &lt;activity
            android:name=&quot;com.alipay.sdk.app.H5PayActivity&quot;
            android:configChanges=&quot;orientation|keyboardHidden|navigation|screenSize&quot;
            android:exported=&quot;false&quot;
            android:screenOrientation=&quot;behind&quot;
            android:windowSoftInputMode=&quot;adjustResize|stateHidden&quot; &gt;
        &lt;/activity&gt;
        &lt;activity
            android:name=&quot;com.alipay.sdk.app.H5AuthActivity&quot;
            android:configChanges=&quot;orientation|keyboardHidden|navigation&quot;
            android:exported=&quot;false&quot;
            android:screenOrientation=&quot;behind&quot;
            android:windowSoftInputMode=&quot;adjustResize|stateHidden&quot; &gt;
        &lt;/activity&gt;

        &lt;!-- &#x652F;&#x4ED8;&#x5B9D;&#x652F;&#x4ED8; end --&gt;

         &lt;!-- &#x94F6;&#x8054;&#x652F;&#x4ED8; --&gt;
                &lt;uses-library android:name=&quot;org.simalliance.openmobileapi&quot; android:required=&quot;false&quot;/&gt;
                &lt;activity
                    android:name=&quot;com.unionpay.uppay.PayActivity&quot;
                    android:screenOrientation=&quot;portrait&quot;
                    android:configChanges=&quot;orientation|keyboardHidden&quot;
                    android:excludeFromRecents=&quot;true&quot;
                    android:windowSoftInputMode=&quot;adjustResize&quot;/&gt;
                &lt;activity
                    android:name=&quot;com.unionpay.UPPayWapActivity&quot;
                    android:configChanges=&quot;orientation|keyboardHidden|fontScale&quot;
                    android:screenOrientation=&quot;portrait&quot;
                    android:windowSoftInputMode=&quot;adjustResize&quot; &gt;
                &lt;/activity&gt;
                &lt;!-- &#x94F6;&#x8054;&#x652F;&#x4ED8; end --&gt;
</code></pre><h3 id="3-&#x53D1;&#x8D77;&#x652F;&#x4ED8;">3. &#x53D1;&#x8D77;&#x652F;&#x4ED8;</h3>
<h5 id="31-&#x5FAE;&#x4FE1;&#x652F;&#x4ED8;">3.1 &#x5FAE;&#x4FE1;&#x652F;&#x4ED8;</h5>
<pre><code>JPay.getIntance(mContext).toPay(JPay.PayMode.WXPAY, payParameters, new JPay.JPayListener() {
            @Override
            public void onPaySuccess() {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x6210;&#x529F;&quot;, Toast.LENGTH_SHORT).show()
            }

            @Override
            public void onPayError(int error_code, String message) {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x5931;&#x8D25;&gt;&quot;+error_code+&quot; &quot;+ message, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayCancel() {
                Toast.makeText(mContext, &quot;&#x53D6;&#x6D88;&#x4E86;&#x652F;&#x4ED8;&quot;, Toast.LENGTH_SHORT).show();
            }
        });
</code></pre><p><code>payParameters</code> &#x4E3A;JSON&#x5B57;&#x7B26;&#x4E32;&#x683C;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>{
  &quot;appId&quot;: &quot;&quot;,
  &quot;partnerId&quot;: &quot;&quot;,
  &quot;prepayId&quot;: &quot;&quot;,
  &quot;sign&quot;: &quot;&quot;,
  &quot;nonceStr&quot; : &quot;&quot;,
  &quot;timeStamp&quot;: &quot;&quot;
}
</code></pre><p>&#x6216;&#x8005;</p>
<pre><code>JPay.getIntance(mContext).toWxPay(appId, partnerId, prepayId, nonceStr, timeStamp, sign, new JPay.JPayListener() {
            @Override
            public void onPaySuccess() {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x6210;&#x529F;&quot;, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayError(int error_code, String message) {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x5931;&#x8D25;&gt;&quot;+error_code+&quot; &quot;+ message, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayCancel() {
                Toast.makeText(mContext, &quot;&#x53D6;&#x6D88;&#x4E86;&#x652F;&#x4ED8;&quot;, Toast.LENGTH_SHORT).show();
            }
        });
</code></pre><h5 id="32-&#x652F;&#x4ED8;&#x5B9D;&#x652F;&#x4ED8;">3.2 &#x652F;&#x4ED8;&#x5B9D;&#x652F;&#x4ED8;</h5>
<pre><code>JPay.getIntance(mContext).toPay(JPay.PayMode.ALIPAY, orderInfo, new JPay.JPayListener() {
            @Override
            public void onPaySuccess() {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x6210;&#x529F;&quot;, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayError(int error_code, String message) {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x5931;&#x8D25;&gt;&quot;+error_code+&quot; &quot;+ message, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayCancel() {
                Toast.makeText(mContext, &quot;&#x53D6;&#x6D88;&#x4E86;&#x652F;&#x4ED8;&quot;, Toast.LENGTH_SHORT).show();
            }
        });
</code></pre><p>&#x6216;&#x8005;</p>
<pre><code>Alipay.getInstance(mContext).startAliPay(orderInfo, new JPay.JPayListener() {
            @Override
            public void onPaySuccess() {

            }

            @Override
            public void onPayError(int error_code, String message) {

            }

            @Override
            public void onPayCancel() {

            }
        });
</code></pre><h5 id="33-&#x94F6;&#x8054;&#x652F;&#x4ED8;">3.3 &#x94F6;&#x8054;&#x652F;&#x4ED8;</h5>
<p>&#x6B65;&#x9AA4;&#x4E00; &#x8C03;&#x8D77;&#x94F6;&#x8054;&#x624B;&#x673A;&#x63A7;&#x4EF6;&#x652F;&#x4ED8;</p>
<pre><code>JPay.getIntance(mContext).toUUPay(&quot;01&quot;,tn, new JPay.JPayListener() {
            @Override
            public void onPaySuccess() {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x6210;&#x529F;&quot;, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayError(int error_code, String message) {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x5931;&#x8D25;&gt;&quot; + error_code + &quot; &quot; + message, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onPayCancel() {
                Toast.makeText(mContext, &quot;&#x53D6;&#x6D88;&#x4E86;&#x652F;&#x4ED8;&quot;, Toast.LENGTH_SHORT).show();
            }

            @Override
            public void onUUPay(String dataOrg, String sign, String mode) {
                Toast.makeText(mContext, &quot;&#x652F;&#x4ED8;&#x6210;&#x529F;&gt;&#x9700;&#x8981;&#x540E;&#x53F0;&#x67E5;&#x8BE2;&#x8BA2;&#x5355;&#x786E;&#x8BA4;&gt;&quot;+dataOrg+&quot; &quot;+mode, Toast.LENGTH_SHORT).show();
            }
        });
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;
&#x7B2C;&#x4E00;&#x4E2A;&#x53C2;&#x6570;<code>mode</code> &quot;00&quot; - &#x542F;&#x52A8;&#x94F6;&#x8054;&#x6B63;&#x5F0F;&#x73AF;&#x5883; &quot;01&quot; - &#x8FDE;&#x63A5;&#x94F6;&#x8054;&#x6D4B;&#x8BD5;&#x73AF;&#x5883;
&#x7B2C;&#x4E8C;&#x4E2A;&#x53C2;&#x6570;<code>tn</code> &#x540E;&#x53F0;&#x83B7;&#x53D6;&#x4E0B;&#x5355;&#x4EA4;&#x6613;&#x7684;&#x6D41;&#x6C34;&#x53F7;
&#x7B2C;&#x4E09;&#x65B9;&#x53C2;&#x6570;&#x662F;<code>JPay</code> &#x5C01;&#x88C5;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x7ED3;&#x679C;&#x7684;&#x56DE;&#x8C03;,&#x9700;&#x8981;&#x5728;<code>onUUPay</code>&#x4E2D;&#x81EA;&#x884C;&#x53BB;&#x540E;&#x53F0;&#x67E5;&#x8BE2;&#x8BA2;&#x5355;&#x7684;&#x6700;&#x7EC8;&#x652F;&#x4ED8;&#x72B6;&#x6001;</p>
</blockquote>
<p>&#x6B65;&#x9AA4;&#x4E8C; &#x8BBE;&#x7F6E;&#x56DE;&#x8C03;</p>
<pre><code>@Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        try {
            UPPay.getInstance(this).onUUPayResult(data);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        super.onActivityResult(requestCode, resultCode, data);
    }
</code></pre><h3 id="4&#x6848;&#x4F8B;&#x7684;&#x4F7F;&#x7528;">4.&#x6848;&#x4F8B;&#x7684;&#x4F7F;&#x7528;</h3>
<blockquote>
<p>appId&#x4EE5;&#x53CA;&#x76F8;&#x5173;&#x7684;key&#x6211;&#x4EEC;&#x90FD;&#x4ECE;&#x670D;&#x52A1;&#x7AEF;&#x83B7;&#x53D6;</p>
</blockquote>
<h4 id="41-&#x5BA2;&#x6237;&#x7AEF;&#x4F7F;&#x7528;&#x8BF4;&#x660E;">4.1 &#x5BA2;&#x6237;&#x7AEF;&#x4F7F;&#x7528;&#x8BF4;&#x660E;</h4>
<ol>
<li>&#x5C06;<code>AndroidManifest.xml</code> &#x7684;&#x5305;&#x540D;&#x4FEE;&#x6539;&#x4E3A;&#x7533;&#x8BF7;&#x5E94;&#x7528;&#x7684;&#x5305;&#x540D;</li>
<li>&#x5C06;&#x5E94;&#x7528;&#x4E2D;&#x7684;<code>build.gradle</code>&#x7684; <code>applicationId</code>&#x4FEE;&#x6539;&#x4E3A;&#x7533;&#x8BF7;&#x5E94;&#x7528;&#x7684;&#x5305;&#x540D;</li>
<li>&#x6D4B;&#x8BD5;&#x7684;&#x65F6;&#x5019;&#x4FEE;&#x6539;&#x9ED8;&#x8BA4;&#x7684;&#x7B7E;&#x540D;key</li>
</ol>
<blockquote>
<p>&#x5C06;key&#x590D;&#x5236;&#x5230;&#x9879;&#x76EE;&#x7684;&#x6839;&#x76EE;&#x5F55;(app)&#x4E2D;&#x5E76;&#x4FEE;&#x6539;<code>buildTypes</code> &#x914D;&#x7F6E;&#x5982;&#x4E0B;</p>
</blockquote>
<pre><code> signingConfigs {
        release {
            storeFile file(&quot;wxkey&quot;)
            storePassword &apos;123456&apos;
            keyAlias &apos;1&apos;
            keyPassword &apos;123456&apos;
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile(&apos;proguard-android.txt&apos;), &apos;proguard-rules.pro&apos;
        }
        debug {
            signingConfig signingConfigs.release
        }
    }
</code></pre><h4 id="42-&#x670D;&#x52A1;&#x7AEF;">4.2 &#x670D;&#x52A1;&#x7AEF;</h4>
<p><a href="https://github.com/javen205/IJPay" target="_blank">IJPay &#x8BA9;&#x652F;&#x4ED8;&#x89E6;&#x624B;&#x53EF;&#x53CA;&#xFF0C;&#x5C01;&#x88C5;&#x4E86;&#x5FAE;&#x4FE1;&#x652F;&#x4ED8;&#x3001;&#x652F;&#x4ED8;&#x5B9D;&#x652F;&#x4ED8;&#x3001;&#x94F6;&#x8054;&#x652F;&#x4ED8;&#x5E38;&#x7528;&#x7684;&#x652F;&#x4ED8;&#x65B9;&#x5F0F;&#x4EE5;&#x53CA;&#x5404;&#x79CD;&#x5E38;&#x7528;&#x7684;&#x63A5;&#x53E3;</a></p>
<h4 id="43-&#x53C2;&#x8003;&#x8D44;&#x6599;">4.3 &#x53C2;&#x8003;&#x8D44;&#x6599;</h4>
<p>&#x5FAE;&#x4FE1;&#x3001;&#x652F;&#x4ED8;&#x5B9D;APP&#x652F;&#x4ED8;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x53C2;&#x8003;&#x8D44;&#x6599; <a href="http://blog.csdn.net/zyw_java" target="_blank">&#x535A;&#x5BA2;&#x5730;&#x5740;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/70341106" target="_blank">10&#x5206;&#x949F;&#x642D;&#x5EFA;&#x5C5E;&#x4E8E;&#x81EA;&#x5DF1;&#x7684;ngork&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x5B9E;&#x73B0;&#x5185;&#x7F51;&#x7A7F;&#x900F;</a>
<a href="http://blog.csdn.net/zyw_java/article/details/54024232" target="_blank">Android&#x7248;-&#x5FAE;&#x4FE1;APP&#x652F;&#x4ED8;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/54024238" target="_blank">Android&#x7248;-&#x652F;&#x4ED8;&#x5B9D;APP&#x652F;&#x4ED8;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/54024253" target="_blank">&#x652F;&#x4ED8;&#x5B9D;Wap&#x652F;&#x4ED8;&#x4F60;&#x4E86;&#x89E3;&#x591A;&#x5C11;&#xFF1F;</a></p>
<p><strong>&#x5E7F;&#x800C;&#x544A;&#x4E4B;</strong></p>
<p><a href="http://git.oschina.net/javen205/weixin_guide" target="_blank">&#x5FAE;&#x4FE1;&#x516C;&#x4F17;&#x53F7;&#x5F00;&#x53D1;&#xFF1A;&#x8BA2;&#x9605;&#x53F7;&#x3001;&#x670D;&#x52A1;&#x53F7;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/61420290" target="_blank">AndroidStudio&#x591A;&#x6E20;&#x9053;&#x6253;&#x5305;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/60336030" target="_blank">Android&#x4F9D;&#x8D56;&#x7BA1;&#x7406;&#x4E0E;&#x79C1;&#x670D;&#x642D;&#x5EFA;</a></p>
<p><a href="http://blog.csdn.net/zyw_java/article/details/60336189" target="_blank">Android Studio &#x4E0A;&#x4F20;aar(Library)&#x5230;JCenter</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="IJPay.html" class="navigation navigation-prev " aria-label="Previous page: What is a IJPay?">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="weixin_guide.html" class="navigation navigation-next " aria-label="Next page: 极速开发微信公众号">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Android支付SDK-JPay","level":"1.6.2","depth":2,"next":{"title":"极速开发微信公众号","level":"1.6.3","depth":2,"path":"doc/opensource/weixin_guide.md","ref":"doc/opensource/weixin_guide.md","articles":[]},"previous":{"title":"What is a IJPay?","level":"1.6.1","depth":2,"path":"doc/opensource/IJPay.md","ref":"doc/opensource/IJPay.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"doc/opensource/JPay.md","mtime":"2018-09-27T15:07:51.340Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-28T14:55:50.579Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

